<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <%@ include file="/WEB-INF/views/include/head.jsp"%> 
        <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
        <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
        <link rel="stylesheet" href="${ctxStatic}/css/list.css">
        
        <script type="text/javascript">
			$(document).ready(function(){
				
	            // 下拉选框带搜索功能
	            $("#ognizationCategoryCd").select2();
				searchListForm();
			});
	               
	    	function searchListForm() {
	    		var params = $("#searchForm").serialize();
	    		$("#activity_pane").showLoading();
	    		$.post("${ctx}/supplier/message/searchList",params, function(result) {
	    			var listHtml = result["ognization"];
	    			var pageHtml = result["page"];
	    			$("#listHtml").html(listHtml);
	    			$("#paging").html(pageHtml);
	    			$("#activity_pane").hideLoading();
	    		}, 'json');
	    	}
	    	
	        
	        //重置
	        function clean(){
	            $("input").val("");
	            $('#ognizationCategoryCd').val('');
	            $("#ognizationCategoryCd").select2(); 
	            searchListForm();
	        }
	        
	        $(document).keydown(function(event){
	        	if(event.keyCode == 13){
	        		searchListForm();
	        	}
	        }); 
        </script> 
    </head>
    <body>
    <form  id="searchForm" method="post">
    <c:set value="<%=ResourcesUtil.getConfig(\"supplier_category\")%>" var="supplierCategory" />
    <div class="listArea" id="activity_pane">    
	    <div class="listBg">
            <div class="searchArea clearfix">
                <div class="searchLeft clearfix">
                    <div class="searchInp clearfix">
                        <p><spring:message code="supplier_txt_supplier"/></p>
                        <input type="text" class="w-customer"  id="ognizationName"  name="ognizationName"  value="${ognization.ognizationName}" >
                    </div>
                    <div class="searchInp clearfix">
                   		<p><spring:message code="supplier_cob_supplier_category"/></p>
                            <select id="ognizationCategoryCd" name="ognizationCategoryCd" class="w-styleCategory">
                            <option value=""><spring:message code="supplier_pleaseChoose"/></option>
                                <c:forEach items="${fns:getDictList(supplierCategory)}" var="category">
                                    <option <c:if test="${fn:split(ognization.ognizationCategoryCd,'-')[1] eq category.itemValue}">selected="selected"</c:if> value="${category.itemCode}-${category.itemValue}" > 
                                        ${category.itemName}
                                    </option>
                                </c:forEach>
                            </select>
                	</div>
                </div>
                <div class="searchRight clearfix">
                    <button  type="button" id="searchBtn" onclick="searchListForm();"><spring:message code="commom_check"/></button>
                    <button type="button"  onclick="clean();"><spring:message code="common_reset"/></button>
                    <shiro:hasPermission name="supplier:message:edit">
                    <button type="button" onclick="popup('900px','584px','${ctx}/supplier/message/form')"><spring:message code="common_create"/></button>
                    </shiro:hasPermission>
                </div>
            </div>
    
            <div class="tableArea">
				<div class="tableScrollSm" style="overflow: auto;width: 1285px;height: 710px; ">
                    <table cellpadding="0" class="tableHead">
                        <thead>
                            <tr>
                                <th><p class="table-No"><spring:message code="common_no"/></p></th>
                                <th><p class="table-cus-name"><spring:message code="supplier_name"/></p></th>
		                        <th><p class="table-cus-simple"><spring:message code="supplier_simple_name"/></p></th>
		                        <th><p class="table-cus-category"><spring:message code="supplier_supplier_category"/></p></th>
		                        <th><p class="table-cus-level"><spring:message code="supplier_supplier_level"/></p></th>
		                        <th><p class="table-cus-addr"><spring:message code="supplier_supplier_address"/></p></th>
		                        <th><p class="table-cus-person"><spring:message code="supplier_list_contact_person"/></p></th>
		                        <th><p class="table-cus-phone"><spring:message code="supplier_list_contact_phone"/></p></th>
		                        <th><p class="table-cus-zipcode"><spring:message code="supplier_supplier_zipcode"/></p></th>
		                        <th><p class="table-cjz"><spring:message code="supplier_list_creater"/></p></th>
		                        <th><p class="table-rq"><spring:message code="supplier_list_create_date"/></p></th>
                            </tr>
                        </thead>
                    </table>
                    <table cellpadding="0" class="tableBody">
					    <tbody  id = "listHtml"></tbody>	
                	</table>
            	</div>
        	</div>
        </div>
        <div id = "paging" ></div>
      </div> 
      </form>      
    </body>
</html>